package vn.easyticket.db.facet;

import java.io.Serializable;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.transaction.annotation.Transactional;

import vn.easyticket.db.entity.AbstractEntity;

@Transactional
public interface AbstractReposityService<T extends AbstractEntity, S extends Serializable>
{
    public long count();

    public void delete( Iterable<? extends T> entities );

    public void delete( S id );

    public void delete( T entity );

    public void deleteAll();

    public boolean exists( S id );

    public Iterable<T> findAll();

    public Iterable<T> findAll( Iterable<S> ids );

    public Page<T> findAll( Pageable pageable );

    public Iterable<T> findAll( Sort sort );

    public T findOne( S id );

    public <T_ extends T> Iterable<T_> save( Iterable<T_> entities );

    public <U extends T> U save( U entity );
}
